home *** CD-ROM | disk | FTP | other *** search
- Attribute VB_Name = "Cell_Formatting"
- '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
- '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
- ''
- '' Cell_Formatting Module for Visual Basic 4
- ''
- '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
- '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
- Option Explicit
-
- '' Constants for the Format types
- Global Const SIMPLE = 0
- Global Const CLASSIC1 = 1
- Global Const CLASSIC2 = 2
- Global Const CLASSIC3 = 3
- Global Const ACCOUNTING1 = 4
- Global Const ACCOUNTING2 = 5
- Global Const ACCOUNTING3 = 6
- Global Const COLORFUL1 = 7
- Global Const COLORFUL2 = 8
- Global Const COLORFUL3 = 9
- Global Const COLORFUL4 = 10
- Global Const LIST1 = 11
- Global Const LIST2 = 12
- Global Const LIST3 = 13
- Global Const EFFECTS3D1 = 14
- Global Const EFFECTS3D2 = 15
-
- Public Sub FormatCells(SS As Object, how%)
- '' This routine formats the sheet. A little extra work is done so it will
- '' be easy to apply this code to any selection.
- Dim hdrRange$, ftrRange$, col1Range$, bodyRange$, savedSelection$, i&
-
- With SS
- '' To make this work with any selection you will want to enable
- '' selections, scrollbars, and remove the following line.
- .SetSelection 2, 2, 8, 6
- '' Clear all formats
- .EditClear 2
- hdrRange = GetHdrRangeFromSelection(SS)
- ftrRange = GetFtrRangeFromSelection(SS)
- col1Range = GetCol1RangeFromSelection(SS)
- bodyRange = GetBodyRangeFromSelection(SS)
-
- '' All functions below preserve the initial seleciton
- Select Case how
- Case SIMPLE: ' Simple
- Call TopMediumBorder(SS, hdrRange, 0)
- Call BottomMediumBorder(SS, ftrRange, 0)
- Call TopThinBorder(SS, ftrRange, 0)
- Call BottomThinBorder(SS, hdrRange, 0)
- Call AdjustFont(SS, hdrRange, 0, True, False, False)
- Call AlignCenter(SS, hdrRange)
-
- Case CLASSIC1: ' Classic 1
- Call TopMediumBorder(SS, hdrRange, 0)
- Call BottomMediumBorder(SS, ftrRange, 0)
- Call TopThinBorder(SS, ftrRange, 0)
- Call BottomThinBorder(SS, hdrRange, 0)
- Call RightThinBorder(SS, col1Range, 0)
- Call AdjustFont(SS, hdrRange, 0, False, True, False)
- Call AlignCenter(SS, hdrRange)
-
- Case CLASSIC2: ' Classic 2
- Call TopMediumBorder(SS, hdrRange, 0)
- Call BottomMediumBorder(SS, ftrRange, 0)
- Call TopThinBorder(SS, ftrRange, 0)
- Call BottomThinBorder(SS, hdrRange, 0)
- Call SetSolidPattern(SS, col1Range, .PaletteEntry(15), 0)
- Call SetSolidPattern(SS, hdrRange, .PaletteEntry(13), 0)
- Call AdjustFont(SS, hdrRange, RGB(255, 255, 255), False, False, False)
- Call AdjustFont(SS, col1Range, 0, True, False, False)
- Call AlignCenter(SS, hdrRange)
-
- Case CLASSIC3: ' Classic 3
- Call TopMediumBorder(SS, hdrRange, 0)
- Call BottomMediumBorder(SS, hdrRange, 0)
- Call TopMediumBorder(SS, ftrRange, 0)
- Call BottomMediumBorder(SS, ftrRange, 0)
- Call OutlineMediumBorder(SS, .Selection, 0)
- Call SetSolidPattern(SS, col1Range, .PaletteEntry(15), 0)
- Call SetSolidPattern(SS, bodyRange, .PaletteEntry(15), 0)
- Call SetSolidPattern(SS, hdrRange, .PaletteEntry(11), 0)
- Call SetSolidPattern(SS, ftrRange, .PaletteEntry(2), 0)
- Call AdjustFont(SS, hdrRange, RGB(255, 255, 255), True, True, False)
- Call AlignRight(SS, hdrRange)
-
- Case ACCOUNTING1:
- Call TopThinBorder(SS, ftrRange, 0)
- Call BottomThinBorder(SS, hdrRange, 0)
- Call BottomDoubleBorder(SS, ftrRange, 0)
- Call AdjustFont(SS, hdrRange, QBColor(2), True, True, False)
- Call AlignRight(SS, hdrRange)
- Call SetNumberFormat(SS, bodyRange, "#,##0.00_);(#,##0.00)")
- Call SetNumberFormat(SS, ftrRange, "$ #,##0.00_);($ #,##0.00)")
- savedSelection = .Selection
- .SetSelection .SelStartRow + 1, .SelStartCol + 1, .SelStartRow + 1, .SelEndCol
- Call SetNumberFormat(SS, .Selection, "$ #,##0.00_);($ #,##0.00)")
- .Selection = savedSelection
-
- Case ACCOUNTING2:
- Call TopThickBorder(SS, hdrRange, .PaletteEntry(13))
- Call BottomThickBorder(SS, ftrRange, .PaletteEntry(13))
- Call TopThinBorder(SS, ftrRange, .PaletteEntry(13))
- Call BottomThinBorder(SS, hdrRange, .PaletteEntry(13))
- Call AlignRight(SS, hdrRange)
- Call SetNumberFormat(SS, bodyRange, "#,##0.00_);(#,##0.00)")
- Call SetNumberFormat(SS, ftrRange, "$ #,##0.00_);($ #,##0.00)")
- savedSelection = .Selection
- .SetSelection .SelStartRow + 1, .SelStartCol + 1, .SelStartRow + 1, .SelEndCol
- Call SetNumberFormat(SS, .Selection, "$ #,##0.00_);($ #,##0.00)")
- .Selection = savedSelection
-
- Case ACCOUNTING3:
- Call BottomMediumBorder(SS, hdrRange, .PaletteEntry(13))
- savedSelection = .Selection
- .SetSelection .SelEndRow, .SelStartCol + 1, .SelEndRow, .SelEndCol
- Call TopThinBorder(SS, .Selection, 0)
- Call BottomDoubleBorder(SS, .Selection, 0)
- .Selection = savedSelection
- Call AdjustFont(SS, hdrRange, 0, False, True, False)
- Call AdjustFont(SS, col1Range, 0, False, True, False)
- Call AlignRight(SS, hdrRange)
- Call SetNumberFormat(SS, bodyRange, "#,##0.00_);(#,##0.00)")
- Call SetNumberFormat(SS, ftrRange, "$ #,##0.00_);($ #,##0.00)")
- savedSelection = .Selection
- .SetSelection .SelStartRow + 1, .SelStartCol + 1, .SelStartRow + 1, .SelEndCol
- Call SetNumberFormat(SS, .Selection, "$ #,##0.00_);($ #,##0.00)")
- .Selection = savedSelection
-
- Case COLORFUL1: ' Colorful 1
- Call BottomThinBorder(SS, .Selection, .PaletteEntry(8))
- Call SetSolidPattern(SS, .Selection, .PaletteEntry(14), 0)
- Call SetSolidPattern(SS, col1Range, .PaletteEntry(11), 0)
- Call SetSolidPattern(SS, hdrRange, 0, 0)
- Call OutlineMediumBorder(SS, .Selection, .PaletteEntry(14))
- Call AdjustFont(SS, .Selection, RGB(255, 255, 255), False, False, False)
- Call AdjustFont(SS, col1Range, RGB(255, 255, 255), True, True, False)
- Call AdjustFont(SS, hdrRange, RGB(255, 255, 255), True, True, False)
- Call AlignCenter(SS, hdrRange)
-
- Case COLORFUL2: ' Colorful 2
- Call TopMediumBorder(SS, hdrRange, 0)
- Call BottomMediumBorder(SS, ftrRange, 0)
- Call TopThinBorder(SS, ftrRange, 0)
- Call BottomThinBorder(SS, hdrRange, 0)
- Call SetHatchPattern4(SS, .Selection, .PaletteEntry(6), .PaletteEntry(2))
- Call SetSolidPattern(SS, hdrRange, .PaletteEntry(9), 0)
- Call AdjustFont(SS, hdrRange, RGB(255, 255, 255), True, True, False)
- Call AdjustFont(SS, col1Range, 0, True, True, False)
- Call AlignRight(SS, hdrRange)
-
- Case COLORFUL3: ' Colorful 3
- Call SetSolidPattern(SS, .Selection, 0, 0)
- Call AdjustFont(SS, .Selection, QBColor(15), False, False, False)
- Call AdjustFont(SS, hdrRange, QBColor(7), True, True, False)
- Call AdjustFont(SS, col1Range, QBColor(13), True, True, False)
- Call AlignRight(SS, hdrRange)
-
- Case COLORFUL4: ' Colorful 4
- Call TopThinBorder(SS, ftrRange, 0)
- Call RightThinBorder(SS, col1Range, 0)
- Call OutlineMediumBorder(SS, .Selection, 0)
- Call SetHatchPattern4(SS, .Selection, .PaletteEntry(6), .PaletteEntry(2))
- Call SetSolidPattern(SS, hdrRange, 0, 0)
- Call AdjustFont(SS, hdrRange, QBColor(14), True, True, False)
- Call AdjustFont(SS, col1Range, QBColor(1), True, True, False)
- Call AlignRight(SS, hdrRange)
-
- '' The list formats don't fit into the 5 range schema. It would
- '' be better to use ranges by number instead of string.
- Case LIST1:
- Call OutlineThinBorder(SS, .Selection, .PaletteEntry(14))
- Call SetSolidPattern(SS, hdrRange, .PaletteEntry(14), 0)
- Call SetSolidPattern(SS, ftrRange, .PaletteEntry(14), 0)
- For i = .SelStartRow + 1 To .SelEndRow - 1 Step 2
- Call SetHatchPattern4(SS, _
- .FormatRCNr(i, .SelStartCol, False) & _
- ":" & _
- .FormatRCNr(i, .SelEndCol, False), _
- .PaletteEntry(19), .PaletteEntry(2))
- Next i
- For i = .SelStartRow + 2 To .SelEndRow - 1 Step 2
- Call SetHatchPattern4(SS, _
- .FormatRCNr(i, .SelStartCol, False) & _
- ":" & _
- .FormatRCNr(i, .SelEndCol, False), _
- .PaletteEntry(4), .PaletteEntry(2))
- Next i
- Call AdjustFont(SS, hdrRange, QBColor(15), True, True, False)
- Call AdjustFont(SS, ftrRange, QBColor(15), True, False, False)
- Call AlignCenter(SS, hdrRange)
- Call SetNumberFormat(SS, ftrRange, "$ #,##0.00_);($ #,##0.00)")
-
- Case LIST2:
- Call OutlineThinBorder(SS, .Selection, .PaletteEntry(14))
- Call TopThickBorder(SS, hdrRange, .PaletteEntry(14))
- Call BottomThickBorder(SS, ftrRange, .PaletteEntry(14))
- Call TopThinBorder(SS, ftrRange, 0)
- Call BottomThinBorder(SS, hdrRange, 0)
- Call AdjustFont(SS, hdrRange, QBColor(4), True, True, False)
- Call AlignCenter(SS, hdrRange)
- Call SetSolidPattern(SS, hdrRange, .PaletteEntry(15), 0)
- For i = .SelStartRow + 1 To .SelEndRow - 1 Step 2
- Call SetSolidPattern(SS, _
- .FormatRCNr(i, .SelStartCol, False) & _
- ":" & _
- .FormatRCNr(i, .SelEndCol, False), _
- .PaletteEntry(15), 0)
- Next i
- Call SetNumberFormat(SS, ftrRange, "$ #,##0.00_);($ #,##0.00)")
-
- Case LIST3:
- Call TopMediumBorder(SS, hdrRange, .PaletteEntry(16))
- Call BottomMediumBorder(SS, hdrRange, .PaletteEntry(16))
- Call TopMediumBorder(SS, ftrRange, .PaletteEntry(16))
- Call BottomMediumBorder(SS, ftrRange, .PaletteEntry(16))
- Call AdjustFont(SS, hdrRange, .PaletteEntry(11), True, False, False)
- Call AlignCenter(SS, hdrRange)
-
- Case EFFECTS3D1: ' 3D Effects 1
- '' Set the back color to black so the 3D effects look good
- .BackColor = .PaletteEntry(15)
- Call SetSolidPattern(SS, .Selection, .PaletteEntry(15), 0)
- '' Here we cheat a little and convert a range string to integers by
- '' setting the current selection.
- savedSelection = .Selection
- .Selection = bodyRange
- Call Inset3DBorder(SS, .SelStartRow, .SelStartCol, .SelEndRow, .SelEndCol)
- .Selection = savedSelection
- Call Raised3DBorder(SS, .SelStartRow, .SelStartCol, .SelEndRow, .SelEndCol)
- Call AdjustFont(SS, hdrRange, .PaletteEntry(13), True, False, False)
- Call AdjustFont(SS, col1Range, 0, True, False, False)
- Call AlignCenter(SS, hdrRange)
-
- Case EFFECTS3D2:
- '' Set the back color to black so the 3D effects look good
- .BackColor = .PaletteEntry(15)
- Call SetSolidPattern(SS, .Selection, .PaletteEntry(15), 0)
- '' Here we cheat a little and convert a range string to integers by
- '' setting the current selection.
- savedSelection = .Selection
- .Selection = bodyRange
- '' Iterate over the rows making every other one inset
- For i = .SelStartRow To .SelEndRow Step 2
- Call Inset3DBorder(SS, i, .SelStartCol, i, .SelEndCol)
- Next i
- '' Now restore the selection
- .Selection = savedSelection
- Call AdjustFont(SS, hdrRange, 0, True, False, False)
- Call AlignCenter(SS, hdrRange)
-
- End Select
-
- '' Adjust column widths in case our number formatting made
- '' some values too wide to fit in the columns.
- .SetColWidthAuto .SelStartRow, .SelStartCol, .SelEndRow, .SelEndCol, True
-
- End With
-
-
- End Sub
-
- '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
- '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
- ''''
- '''' Range Definition Functions
- ''''
- '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
- '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
-
- Private Function GetHdrRangeFromSelection(SS As Object) As String
- '' Selection is set before calling this function
-
- With SS
- GetHdrRangeFromSelection = _
- .FormatRCNr(.SelStartRow, .SelStartCol, False) _
- & ":" & _
- .FormatRCNr(.SelStartRow, .SelEndCol, False)
- End With
-
- End Function
-
- Private Function GetFtrRangeFromSelection(SS As Object) As String
- '' Selection is set before calling this function
-
- With SS
- GetFtrRangeFromSelection = _
- .FormatRCNr(.SelEndRow, .SelStartCol, False) _
- & ":" & _
- .FormatRCNr(.SelEndRow, .SelEndCol, False)
- End With
-
- End Function
-
- Private Function GetCol1RangeFromSelection(SS As Object) As String
- '' Selection is set before calling this function
-
- With SS
- GetCol1RangeFromSelection = _
- .FormatRCNr(.SelStartRow, .SelStartCol, False) _
- & ":" & _
- .FormatRCNr(.SelEndRow, .SelStartCol, False)
- End With
-
- End Function
-
- Private Function GetBodyRangeFromSelection(SS As Object)
- '' Selection is set before calling this function
-
- With SS
- GetBodyRangeFromSelection = _
- .FormatRCNr(.SelStartRow + 1, .SelStartCol + 1, False) _
- & ":" & _
- .FormatRCNr(.SelEndRow - 1, .SelEndCol, False)
- End With
-
- End Function
-
- Private Sub SetNumberFormat(SS As Object, range$, nFormat$)
-
- Dim savedSelection$
-
- With SS
- savedSelection = .Selection
- .Selection = range
- .NumberFormat = nFormat
- .Selection = savedSelection
- End With
-
- End Sub
-
- Private Sub AdjustFont(SS As Object, range$, color&, bold As Boolean, italic As Boolean, underline As Boolean)
-
- Dim fName$, fSize%, savedSelection$
- Dim pBold As Boolean, pItalic As Boolean, pUnderline As Boolean
- Dim pStrikeout As Boolean, pColor As OLE_COLOR, pOutline As Boolean, pShadow As Boolean
-
- With SS
- savedSelection = .Selection
- .Selection = range
- .GetFont fName, fSize, pBold, pItalic, pUnderline, pStrikeout, pColor, pOutline, pShadow
- .SetFont fName, fSize / 20, bold, italic, underline, False, color, False, False
- .Selection = savedSelection
- End With
-
- End Sub
-
- '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
- '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
- ''''
- '''' Alignment Functions
- ''''
- '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
- '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
-
- Private Sub AlignCenter(SS As Object, range$)
-
- Dim savedSelection$
-
- With SS
- savedSelection = .Selection
- .Selection = range
- .SetAlignment F1HAlignCenter, False, F1VAlignBottom, 0
- .Selection = savedSelection
- End With
-
- End Sub
-
- Private Sub AlignRight(SS As Object, range$)
-
- Dim savedSelection$
-
- With SS
- savedSelection = .Selection
- .Selection = range
- .SetAlignment F1HAlignRight, False, F1VAlignBottom, 0
- .Selection = savedSelection
- End With
-
- End Sub
-
- '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
- '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
- ''''
- '''' Border Functions
- ''''
- '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
- '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
-
- Private Sub OutlineThickBorder(SS As Object, range$, color&)
-
- Dim savedSelection$
-
- With SS
- Let savedSelection = .Selection
- .Selection = range
- .SetBorder 5, -1, -1, -1, -1, 0, color, 0, 0, 0, 0
- .Selection = savedSelection
- End With
-
- End Sub
-
- Private Sub TopThickBorder(SS As Object, range$, color&)
-
- Dim savedSelection$
-
- With SS
- Let savedSelection = .Selection
- .Selection = range
- .SetBorder -1, -1, -1, 5, -1, 0, 0, 0, 0, color, 0
- .Selection = savedSelection
- End With
-
- End Sub
-
- Private Sub BottomThickBorder(SS As Object, range$, color&)
-
- Dim savedSelection$
-
- With SS
- Let savedSelection = .Selection
- .Selection = range
- .SetBorder -1, -1, -1, -1, 5, 0, 0, 0, 0, 0, color
- .Selection = savedSelection
- End With
-
- End Sub
-
-
- Private Sub OutlineMediumBorder(SS As Object, range$, color&)
-
- Dim savedSelection$
-
- With SS
- Let savedSelection = .Selection
- .Selection = range
- .SetBorder 2, -1, -1, -1, -1, 0, color, 0, 0, 0, 0
- .Selection = savedSelection
- End With
-
- End Sub
-
- Private Sub LeftMediumBorder(SS As Object, range$, color&)
-
- Dim savedSelection$
-
- With SS
- Let savedSelection = .Selection
- .Selection = range
- .SetBorder -1, 2, -1, -1, -1, 0, color, 0, 0, 0, 0
- .Selection = savedSelection
- End With
-
- End Sub
-
- Private Sub TopMediumBorder(SS As Object, range$, color&)
-
- Dim savedSelection$
-
- With SS
- Let savedSelection = .Selection
- .Selection = range
- .SetBorder -1, -1, -1, 2, -1, 0, 0, 0, 0, color, 0
- .Selection = savedSelection
- End With
-
- End Sub
-
- Private Sub BottomMediumBorder(SS As Object, range$, color&)
-
- Dim savedSelection$
-
- With SS
- Let savedSelection = .Selection
- .Selection = range
- .SetBorder -1, -1, -1, -1, 2, 0, 0, 0, 0, 0, color
- .Selection = savedSelection
- End With
-
- End Sub
-
- Private Sub OutlineThinBorder(SS As Object, range$, color&)
-
- Dim savedSelection$
-
- With SS
- Let savedSelection = .Selection
- .Selection = range
- .SetBorder 1, -1, -1, -1, -1, 0, color, 0, 0, 0, 0
- .Selection = savedSelection
- End With
-
- End Sub
-
- Private Sub RightThinBorder(SS As Object, range$, color&)
-
- Dim savedSelection$
-
- With SS
- Let savedSelection = .Selection
- .Selection = range
- .SetBorder -1, -1, 1, -1, -1, 0, 0, 0, color, 0, 0
- .Selection = savedSelection
- End With
-
- End Sub
-
- Private Sub TopThinBorder(SS As Object, range$, color&)
-
- Dim savedSelection$
-
- With SS
- Let savedSelection = .Selection
- .Selection = range
- .SetBorder -1, -1, -1, 1, -1, 0, 0, 0, 0, color, 0
- .Selection = savedSelection
- End With
-
- End Sub
-
- Private Sub BottomThinBorder(SS As Object, range$, color&)
-
- Dim savedSelection$
-
- With SS
- Let savedSelection = .Selection
- .Selection = range
- .SetBorder -1, -1, -1, -1, 1, 0, 0, 0, 0, 0, color
- .Selection = savedSelection
- End With
-
- End Sub
-
- Private Sub BottomDoubleBorder(SS As Object, range$, color&)
-
- Dim savedSelection$
-
- With SS
- Let savedSelection = .Selection
- .Selection = range
- .SetBorder -1, -1, -1, -1, 6, 0, 0, 0, 0, 0, color
- .Selection = savedSelection
- End With
-
- End Sub
-
- '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
- '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
- ''''
- '''' 3D Effect Functions
- ''''
- '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
- '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
-
- Private Sub Inset3DBorder(SS As Object, r1&, c1&, r2&, c2&)
-
- Dim savedSelection$
-
- With SS
- Let savedSelection = .Selection
- .SetSelection r1, c1, r2, c2
- .SetBorder 2, -1, -1, -1, -1, -1, .PaletteEntry(48), 0, 0, 0, 0
- .SetSelection r1, c2, r2, c2
- .SetBorder -1, -1, 2, -1, -1, 0, 0, 0, .PaletteEntry(2), 0, 0
- .SetSelection r2, c1, r2, c2
- .SetBorder -1, -1, -1, -1, 2, 0, 0, 0, 0, 0, .PaletteEntry(2)
- .Selection = savedSelection
- End With
-
- End Sub
-
- Private Sub Raised3DBorder(SS As Object, r1&, c1&, r2&, c2&)
-
- Dim savedSelection$
-
- With SS
- Let savedSelection = .Selection
- .SetSelection r1, c1, r2, c2
- .SetBorder 2, -1, -1, -1, -1, -1, .PaletteEntry(2), 0, 0, 0, 0
- .SetSelection r1, c2, r2, c2
- .SetBorder -1, -1, 2, -1, -1, 0, 0, 0, .PaletteEntry(48), 0, 0
- .SetSelection r2, c1, r2, c2
- .SetBorder -1, -1, -1, -1, 2, 0, 0, 0, 0, 0, .PaletteEntry(48)
- .Selection = savedSelection
- End With
-
- End Sub
-
- '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
- '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
- ''''
- '''' Pattern Functions
- ''''
- '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
- '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
-
- Private Sub SetSolidPattern(SS As Object, range$, fcolor&, bcolor&)
-
- Dim savedSelection$
-
- With SS
- Let savedSelection = .Selection
- .Selection = range
- .SetPattern 1, fcolor, bcolor
- .Selection = savedSelection
- End With
-
- End Sub
-
- Private Sub SetHatchPattern4(SS As Object, range$, fcolor&, bcolor&)
-
- Dim savedSelection$
-
- With SS
- Let savedSelection = .Selection
- .Selection = range
- .SetPattern 4, fcolor, bcolor
- .Selection = savedSelection
- End With
-
- End Sub
-
-